#include <stdio.h>

double SumFac(int x);

int main()
{
    int n;
    scanf("%d", &n);
    printf("%.10g\n", SumFac(n));
    return 0;
}

double SumFac(int x)
{
    double sum=0;
    double result=1;
    for(int i=0;i<=x;i++)
    {
        if(i==0)
        {
            result=1;
        }
        else
        {
            result*=i;
        }
        sum+=result;
    }
    return sum;
}
